package com.bdqn.ch05.controller;

import com.bdqn.ch05.pojo.SysUser;
import com.bdqn.ch05.service.SysUserService;
import org.springframework.web.bind.annotation.*;
import sun.rmi.runtime.Log;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class SysUserController {
    @Resource
    private SysUserService sysUserService;

    @RequestMapping(value = "/getUser",method = RequestMethod.GET)
    public SysUser getSysUser(Long usrId){
        return sysUserService.getSysUser(usrId);
    }


    @GetMapping(value = "/users")
    public List<SysUser> findAllSysUsers(){
        return sysUserService.findAllSysUsers();
    }

    @GetMapping(value = "/user/{id}")
    public SysUser getUser(@PathVariable("id")Long usrId){

        return sysUserService.getSysUser(usrId);
    }
}
